package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner sc=new Scanner(System.in);
        System.out.println("单独输入exit退出程序");
        while (true){
            String line= sc.nextLine();
            if ("exit".equals(line)){
                System.out.println("结束程序");
                break;
            }else {
                fos.write(line.getBytes(StandardCharsets.UTF_8));
            }
        }
        fos.close();
    }
}
